Posts tagged with tips and tricks - page 2

How to know external IP address from Linux terminal?

ifconfig displays only local ip address of your system. If your system is directly connected to internet then it will be your external ip address. It may not be the case always. Because you will be behind a router or a modem.
You can know the external IP address by going to www.whatismyip.com or www.ipecho.net. If you want to know it from a terminal type

curl curlmyip.com

What curl do is it fetches the content of the link to the terminal. There are also several other websites that offers this same service. Some of them are listed below.

curl ipecho.net/plain

curl myexternalip.com/raw

curl curlmyip.com


curl ifconfig.me/ip


curl icanhazip.com


curl ip.appspot.com



How to set dns address in android phones?

Ever wondered how setup dns address in android phones. You can do it if your phone is rooted.
You may have a terminal installed with busybox if your phone is rooted. Otherwise install a terminal and gain root permission by typing

su

Then list all the device dns entries using this command

getprop | grep dns

Then set the dns entries by the command

setprop net.rmnet0.dns1  8.8.8.8

Here rmnet0.dns1 is given as an example. This may vary depending on which dns entry you have to choose. 8.8.8.8 is the googles dns server address. Replace it with your choice.

How to see open ports inLinux?

Type this netstat command in terminal.

netstat -tulpn

Or you can use this one.

netstat -l

Try netstat --help to go through other options also...

How to send AT commands?

For details about AT commands refer this link.

If you are using windows you can use hyperterminal to communicate with any modem. In this case the GSM modem. Find a method to connect your GSM modem to the PC  (Refer this Link ). You can use a USB2TTL converter to directly interface your GSM modem to PC. After interfacing the modem go to device manager and find the com port no: assigned to your GSM modem.
After identifying the port number open hyperterminal. You need to download Hyperterminal or copy the files from windows XP. You can also use putty for this purpose. 
Type a name and click OK. Then select the com port you are using and press ok.
Change the boadrate to 9600(you can choose other also. Higher boadrates may not work with some GSM modem) and let other options remain unchanged.

After that type AT and press Enter. If you get a response showing OK. Then everything is fine. As a default typed character are not shown in the terminal. You can enable this by going to File=> Properties=> Settings=>ASCII Setup and check Echo typed characters locally.

You can follow the same procedures in putty also. This is a screenshot of putty.
You can do the same in Linux also. Use minicom or any other terminal softwares for communicating with you GSM modem in Linux. This link describes how to use minicom.
And this link describes how to identify the name of your modem.


How to hide and unhide files in Linux?

If you are new to linux OS, it’s a common mistake to add a (.) in front of your files and suddenly the file disappears. In Linux filenames starting with a dot (.) are hidden. You can intentionally make a folder or file hidden by renaming it.mv filename .filename If you want to view you hidden files or folders, first go to the location where the file resides using cd command.